import java.util.Calendar;
import java.util.Scanner;

public class date {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Calendar c = Calendar.getInstance();
        c.set(2022,1,31);
        System.out.println(c.get(Calendar.DAY_OF_WEEK) - 1);
    }
}
